# 安装erlang
rpm -ivh erlang-21.3.8.21-1.el7.x86_64.rpm
# 安装其他依赖
yum install socat -y
# 安装rabbitmq
rpm -ivh rabbitmq-server-3.8.8-1.el7.noarch.rpm


# 启动服务
systemctl start rabbitmq-server
# 查看服务状态
systemctl status rabbitmq-server
# 开机自启动
systemctl enable rabbitmq-server
# 停止服务
systemctl stop rabbitmq-server
# 重启服务
systemctl restart rabbitmq-server


# 安装web端的客户端插件
rabbitmq-plugins enable rabbitmq_management

# 关闭防火墙
systemctl stop firewalld

# 查询所有rabbitmq账号
rabbitmqctl list_users

# 创建账号和密码
rabbitmqctl add_user admin 123456
# 设置用户角色
rabbitmqctl set_user_tags admin administrator
# 为用户添加资源权限
# set_permissions [-p <vhostpath>] <user> <conf> <write> <read>
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"


# 关闭应用的命令
rabbitmqctl stop_app
# 清除的命令
rabbitmqctl reset
# 重新启动命令
rabbitmqctl start_app